/*
 * Copyright (C) 2019 Baidu, Inc. All Rights Reserved.
 */
package com.bootdo.common.task;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Component;

import com.bootdo.hjh.service.PointsService;
import com.bootdo.oa.domain.Response;

@Component
public class OrderStillJob implements Job {

    private static final Logger LOGGER = LoggerFactory.getLogger(OrderStillJob.class);

    @Autowired
    SimpMessagingTemplate template;
    @Autowired
    private PointsService pointsService;

    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {

        pointsService.orderRetain();
        LOGGER.info("订单驻留跑批结束");
        template.convertAndSend("/topic/getResponse", new Response("订单驻留跑批结束"));

    }

}
